Compatability with new JMS\PropertyMetadata interface#30
Compatability with new JMS\PropertyMetadata interface#30iVariable wants to merge 1 commit intosimplethings:masterfrom
Conversation
|
It would be even better if this bundle could support both JMSSerializerBundle 0.9 and 1.0.x-dev for now (some people prefer waiting for releases before updating) |
|
I couldn't find right way to determine version of JMSSerializer. Only indirect, such as "if (is_array($type))" or "if ( interface_exists("\JMS\SerializerBundle\Serializer\Handler\SerializationHandlerInterface") )". Do you think it's good enough to implement it that way? |
|
@iVariable you don't need to check the version IMO. Using |
|
Any chance to amend and push this through? |
JMS\SerializerBundle\Metadata\PropertyMetadata interface for type has changed. Here is a quickfix for it. Two versions of JMS Serializer support
|
Oops, sorry. Have missed previous comment. PS: I preferred to make simple "if" instead of something like getTypeFromOldSerializer and getTypeFromNewSerializer :)) |
|
Well, instead of duplicating the whole code of the function (requiring to maintain it twice), it would be easier to normalize the type at the beggining: if (is_array($type)) {
// handle JMSSerializerBundle >= 0.10
$type = $type['name'];
}
// All the existing code here without any modification |
|
Don't you forgot about $type['params'] part? And as for me I think this patch is just a quickfix before maintaining JMSSerializer version 1.0. It'll be better to remove support of old Serializer, after Serializer version 1 release. Don't you think so? |
JMS\SerializerBundle\Metadata\PropertyMetadata interface for $type has changed.
Here is a quickfix for it.